package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlTransient;

@Entity
@Table(name = "pos_master_item")
//@NamedQueries({
//    @NamedQuery(name = "PosMasterItem.findAll", query = "SELECT t FROM PosMasterItem t"),
//    @NamedQuery(name = "PosMasterItem.findBySync", query = "SELECT t FROM PosMasterItem t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosMasterItem.findByItemId", query = "SELECT t FROM PosMasterItem t WHERE t.itemId = :itemId"),
//    @NamedQuery(name = "PosMasterItem.findByItemCode", query = "SELECT t FROM PosMasterItem t WHERE t.itemCode = :itemCode"),
//    @NamedQuery(name = "PosMasterItem.findByItemName", query = "SELECT t FROM PosMasterItem t WHERE t.itemName = :itemName")})
public class PosMasterItem implements Serializable {
    @Column(name = "item_name")
    private String itemName;
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "item_id")
    private Integer itemId;
    @Column(name = "item_code")
    private String itemCode;
    @Column(name = "item_code2")
    private String itemCode2;
    @Column(name = "item_barcode")
    private String itemModel;
    @Column(name = "item_model")
    private String itemBarcode;
    @Basic(optional = false)
    @Column(name = "item_price_basic")
    private BigDecimal itemPriceBasic;
    @Basic(optional = false)
    @Column(name = "item_price_shop")
    private BigDecimal itemPriceShop;
    @Basic(optional = false)
    @Column(name = "item_price_franchise")
    private BigDecimal itemPriceFranchise;
    @JoinColumn(name = "item_size_id", referencedColumnName = "size_id")
    @ManyToOne
    private PosMasterSize itemSizeId;
    @JoinColumn(name = "item_color_id", referencedColumnName = "color_id")
    @ManyToOne
    private PosMasterColor itemColorId;
    @JoinColumn(name = "item_supplier_model_id", referencedColumnName = "supplier_model_id")
    @ManyToOne
    private PosMasterSupplierModel itemSupplierModelId;
    @JoinColumn(name = "item_price_buy_id", referencedColumnName = "price_buy_id")
    @ManyToOne
    private PosMasterPriceBuy itemPriceBuyId;
    @JoinColumn(name = "item_price_online_id", referencedColumnName = "price_online_id")
    @ManyToOne
    private PosMasterPriceOnline itemPriceOnlineId;
    @JoinColumn(name = "item_price_gross_id", referencedColumnName = "price_gross_id")
    @ManyToOne
    private PosMasterPriceGross itemPriceGrossId;

    public PosMasterItem() {
    }

    public String getItemCode() {
        return itemCode;
    }

    public String getItemModel() {
        return itemModel;
    }

    public void setItemModel(String itemModel) {
        this.itemModel = itemModel;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getItemCode2() {
        return itemCode2;
    }

    public void setItemCode2(String itemCode2) {
        this.itemCode2 = itemCode2;
    }
    
    public PosMasterColor getItemColorId() {
        return itemColorId;
    }

    public void setItemColorId(PosMasterColor itemColorId) {
        this.itemColorId = itemColorId;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public String getItemBarcode() {
        return itemBarcode;
    }

    public void setItemBarcode(String itemBarcode) {
        this.itemBarcode = itemBarcode;
    }

    public PosMasterPriceBuy getItemPriceBuyId() {
        return itemPriceBuyId;
    }

    public void setItemPriceBuyId(PosMasterPriceBuy itemPriceBuyId) {
        this.itemPriceBuyId = itemPriceBuyId;
    }

    public BigDecimal getItemPriceBasic() {
        return itemPriceBasic;
    }

    public void setItemPriceBasic(BigDecimal itemPriceBasic) {
        this.itemPriceBasic = itemPriceBasic;
    }

    public BigDecimal getItemPriceFranchise() {
        return itemPriceFranchise;
    }

    public void setItemPriceFranchise(BigDecimal itemPriceFranchise) {
        this.itemPriceFranchise = itemPriceFranchise;
    }

    public BigDecimal getItemPriceShop() {
        return itemPriceShop;
    }

    public void setItemPriceShop(BigDecimal itemPriceShop) {
        this.itemPriceShop = itemPriceShop;
    }

    public PosMasterSize getItemSizeId() {
        return itemSizeId;
    }

    public void setItemSizeId(PosMasterSize itemSizeId) {
        this.itemSizeId = itemSizeId;
    }

    public PosMasterSupplierModel getItemSupplierModelId() {
        return itemSupplierModelId;
    }

    public void setItemSupplierModelId(PosMasterSupplierModel itemSupplierModelId) {
        this.itemSupplierModelId = itemSupplierModelId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public PosMasterPriceGross getItemPriceGrossId() {
        return itemPriceGrossId;
    }

    public void setItemPriceGrossId(PosMasterPriceGross itemPriceGrossId) {
        this.itemPriceGrossId = itemPriceGrossId;
    }

    public PosMasterPriceOnline getItemPriceOnlineId() {
        return itemPriceOnlineId;
    }

    public void setItemPriceOnlineId(PosMasterPriceOnline itemPriceOnlineId) {
        this.itemPriceOnlineId = itemPriceOnlineId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemId != null ? itemId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PosMasterItem)) {
            return false;
        }
        PosMasterItem other = (PosMasterItem) object;
        if ((this.itemId == null && other.itemId != null) || (this.itemId != null && !this.itemId.equals(other.itemId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return itemModel + " - " + itemColorId;

    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }
}

  
